﻿#region Copyright Notice
// 
// 
//  
//  Copyright (c) 2009-2011 Anindya Chatterjee
//  
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  
//      http://www.apache.org/licenses/LICENSE-2.0
//  
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
// 
// 
#endregion
namespace AbstractClass.NPerf
{
    /// <summary>
    /// Represents a performance test result.
    /// </summary>
    public class TestResult
    {
        /// <summary>
        /// Gets or sets the duration of the test.
        /// </summary>
        /// <value>The duration of the test.</value>
        public double Duration { get; set; }

        /// <summary>
        /// Gets or sets the duration time period.
        /// </summary>
        /// <value>The duration time period.</value>
        public TimePeriod DurationTimePeriod { get; set; }

        /// <summary>
        /// Gets or sets the memory usage.
        /// </summary>
        /// <value>The memory usage.</value>
        public long MemoryUsage { get; set; }

        /// <summary>
        /// Gets or sets the CPU usage.
        /// </summary>
        /// <value>The CPU usage.</value>
        public long CPUUsage { get; set; }

        /// <summary>
        /// Gets or sets the hit count.
        /// </summary>
        /// <value>The hit count.</value>
        public int HitCount { get; set; }

        /// <summary>
        /// Gets or sets the hit count time unit.
        /// </summary>
        /// <value>The hit count time unit.</value>
        public TimePeriod HitCountTimeUnit { get; set; }

        /// <summary>
        /// Gets or sets the thread count.
        /// </summary>
        /// <value>The thread count.</value>
        public int ThreadCount { get; set; }

        /// <summary>
        /// Gets the memory usage in MB.
        /// </summary>
        /// <value>The memory usage in MB.</value>
        public double MemoryUsageMb
        {
            get { return (double) MemoryUsage / (1024 * 1024); }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is a generic performance counter test unit.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is a generic performance counter test unit; otherwise, <c>false</c>.
        /// </value>
        public bool IsGenericCounterTest { get; set; }

        /// <summary>
        /// Gets or sets the name of the category of the performance counter.
        /// </summary>
        /// <value>The name of the category.</value>
        public string CategoryName { get; set; }

        /// <summary>
        /// Gets or sets the name of the performance counter.
        /// </summary>
        /// <value>The name of the counter.</value>
        public string CounterName { get; set; }

        /// <summary>
        /// Gets or sets the name of the instance of the performance counter.
        /// </summary>
        /// <value>The name of the instance.</value>
        public string InstanceName { get; set; }

        /// <summary>
        /// Average value of performance counter.
        /// </summary>
        public double CounterValue { get; set; }
    }
}